package com.xlh.openai.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.iherus.codegen.Generator;
import org.iherus.codegen.qrcode.QrcodeConfig;
import org.iherus.codegen.qrcode.QreyesFormat;
import org.iherus.codegen.qrcode.SimpleQrcodeGenerator;

/**
 * @author chufangzheng
 */
public class QrcodeUtils {

    private static final QrcodeConfig instance = new QrcodeConfig();

    static {
        instance.setBorderSize(2)
                .setPadding(10)
                .setMasterColor("#778899")
                .setLogoBorderColor("#B0C4DE")
                .setCodeEyesPointColor("#BC8F8F")
                .setCodeEyesFormat(QreyesFormat.DR2_BORDER_C_POINT);
    }

    public static Generator getQrCode(String url) {
        return new SimpleQrcodeGenerator(instance).setLogo("E:\\logo.png").generate(url);
    }

}
